<%--
  Created by IntelliJ IDEA.
  User: 马跃
  Date: 2021/1/14
  Time: 21:59
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html style="height: 100%">
<head>
    <meta charset="UTF-8">
    <title>Insert title here</title>

    <style type="text/css">
        * {
            box-sizing: border-box;
            padding: 0;
            margin: 0;
        }

        div {
            width: 100%;
            height: 100%;
            background-color: white;
            padding-left: 1%;
        }

        #d1 {
            width: 90%;
            height: 5%;
            position: relative;
            background-color: white;
            font-family: "宋体";
            font-size: 14px;
            padding-top: 1%;
            padding-left: 1%;
            padding-right: 1%;
        }

        #d1-1 {
            width: 30%;
            height: 100%;

            float: left;
        }

        #d1-2 {
            width: 4%;
            height: 120%;
            background-color: #009688;
            float: right;
            margin-top: -0.5%;
        }

        #d2 {
            width: 90%;
            height: 16%;
            position: relative;

            padding-top: 1%;
            padding-left: 1%;
        }

        /* 	#d2-1{
               width: 13%;
               height: 100%;
               float:left;
               padding-top: 1%;
           }
           #d2-1 input{
               width: 87%;
               height: 30px;
           } */

        #d2 input {
            width: 10%;
            height: 25px;
        }

        #d2 select {
            width: 10%;
            height: 25px;
        }

        #d3 {
            width: 90%;
            height: 10%;
            position: relative;
            background-color: #EEEEEE;
            padding-top: 1%;
            padding-left: 1%;
        }

        #d3-1 {
            width: 9%;
            height: 70%;
            float: left;
            background-color: red;
            padding-top: 0.5%;
            padding-left: 1%;
        }

        #d3-2 {
            width: 9%;
            height: 70%;
            float: left;
            background-color: green;
            margin-left: 1%;
            padding-top: 0.5%;
            padding-left: 1%;
        }

        #d4 {
            width: 90%;
            height: 67%;
            position: relative;
            margin-top: 1%;
        }

        table {
            border-collapse: collapse;
            line-height: 25px;
            width: 100%;
            height: 80%;
            text-align: center;
        }

        a {

            text-decoration: none;
            color: black;
        }

        #d5 {
            margin-top: -28%;
            margin-left: 40%;
            width: 25%;
            height: 30%;
            position: absolute;
            padding-left: 0;
            display: none;

        }

        #d6 {
            width: 100%;
            height: 16%;

            /* margin-top:10%; */
            position: relative;
            padding-left: 0;
            /* padding-top: 2.3%; */
        }

        #d6-1 {
            width: 50%;
            height: 100%;
            float: left;
            background-color: #EEEEEE;
            padding-left: 32%;
            padding-top: 3%;
        }

        #d6-2 {
            width: 50%;
            height: 100%;
            float: right;
            background-color: #EEEEEE;
            padding-left: 33%;
            padding-top: 3%;
        }

        #d7 {
            width: 95%;
            height: 40%;
            position: relative;
            padding-top: 8%;
            font-family: "宋体";
            font-size: 18px;
            padding-left: 15%;


        }

        #d8 {
            width: 100%;
            height: 40%;
            position: relative;


        }

        #d8-1 {
            width: 22%;
            height: 40%;
            position: absolute;
            background-color: #009688;
            padding-top: 2%;
            text-align: center;
            background-color: #009688;
            margin-top: 10%;
            margin-left: 40%;

        }

        #d8-2 {
            width: 22%;
            height: 40%;
            position: absolute;
            margin-left: 70%;
            margin-top: 10%;
            /* 	margin-right:18%;
                margin-top:-2.4%; */
            border: 1px solid black;
            padding-top: 2%;
            text-align: center;

        }

        #d5 a {
            text-decoration: none;
            color: black;
        }
    </style>
</head>
<body style="height: 100%">
<div>
    <div id="d1">
        <div id="d1-1">首页/演示/导航元素</div>
        <div id="d1-2">
            <a href="/houseQueryAll"><img src="../image/update.png" width="20px" height="20px"></a>
        </div>
    </div>
    <hr width="90%" color="gray">
    <div id="d2">
        <form action="#" method="post">
            所属地区&emsp;<select style="display: line">
            <option value="">请选择</option>
            <option value="">河南</option>
            <option value="">安徽</option>
            <option value="">江苏</option>
        </select>&emsp;
            <select style="display: line">
                <option value="">请选择</option>
                <option value="">郑州</option>
                <option value="">合肥</option>
                <option value="">南京</option>
            </select>&emsp;
            <select style="display: line">
                <option value="">请选择</option>
                <option value="">中原区</option>
                <option value="">宛城区</option>
                <option value="">江宁区</option>
            </select><br><br>
            面积&nbsp;<input type="text" name="" value="" placeholder="平 ">-<input type="text" name="" value=""
                                                                                 placeholder="平 ">
            房租&nbsp;<input type="text" name="" value="" placeholder="¥ ">-<input type="text" name="" value=""
                                                                                 placeholder="¥">
            <input type="text" name="" value="" placeholder="所属小区">
            <input type="submit" value="搜索" style="background-color:#009688 ;width: 5%;">
        </form>
    </div>
    <div id="d3">
        <div id="d3-1">
            <img src="../image/delete2.png" width="20px" height="20px" ">
            <a href="#" id="delete">批量删除</a>
        </div>
        <div id="d3-2">
            <img src="../image/add.png" width="20px" height="20px">
            <a href="./house/houseAdd.html">添加</a>
        </div>
    </div>
    <div id="d4">
        <table border="1">
            <tr>
                <td width="5%">
                    <input type="checkbox" value="">
                </td>
                <td>序号</td>
                <td>房屋地址</td>
                <td>房屋号</td>
                <td>限住人数</td>
                <td>出租价格</td>
                <td>添加时间</td>
                <td>修改时间</td>
                <td>出租状态</td>
                <td width="9%">操作</td>
            </tr>

            <form action="houseDeleteBatches" method="post">
            <c:forEach var="user" items="${list}" varStatus="status">
                <tr>
                    <td><input type="checkbox" value="${user.h_id}" name="key"></td>
                    <td>${status.index}</td>
                    <td>${user.h_address}</td>
                    <td>${user.h_roomNumber}</td>
                    <td>${user.h_limit}</td>
                    <td>${user.h_price}</td>
                    <td>${user.h_addTime}</td>
                    <td>${user.h_updateTime}</td>
                    <td>${user.h_status==1?"已出租":user.h_status==2?"未出租":"停止出租"}</td>
                    <td>
                        <a href="/houseQuery?id=${user.h_id}" target="i">
                            <img src="../image/alert-circle.png" width="20px" height="20px">
                        </a>&nbsp;
                        <a href="/houseUpdate?id=${user.h_id}" target="i">
                            <img src="../image/edit-2.png" width="20px" height="20px">
                        </a>&nbsp;
                        <a href="/houseDelete?id=${user.h_id}">
                            <img src="../image/delete2.png" width="20px" height="20px" onclick="return one()">
                        </a>
                    </td>
                </tr>
            </c:forEach>
                <input type="submit" id="dosth" style="display: none">
            </form>
        </table>
    </div>
</div>
<script type="text/javascript">

    var dodelete = document.getElementById("delete");

    dodelete.onclick = function () {

        var dosth = document.getElementById("dosth");

        dosth.click()

    }

    function one(){

        var b = confirm("确定要删除吗");

        if (b) {
            //location.href = "${pageContext.request.contextPath}/repairDelete?id="+ten.innerText;
            return true;
        } else {
            location.href = "/houseQueryAll";
        }
    }

</script>
</body>
</html>
